package com.ysxsoft.wdg.adapter.center_st;


import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ysxsoft.wdg.R;
import com.ysxsoft.wdg.bean.st.CompanyBean;
import com.ysxsoft.wdg.bean.st.StProductBean;

public class StGoodsAdapter extends BaseQuickAdapter<StProductBean,BaseViewHolder> {


    public StGoodsAdapter(int layoutResId) {
        super(layoutResId);
    }

    public void clear(){
        getData().clear();
        notifyDataSetChanged();
    }


    @Override
    protected void convert(BaseViewHolder helper, StProductBean item) {
        TextView t=helper.getView(R.id.tv_content);
        t.setVisibility(View.GONE);
        helper.setText(R.id.tv_name,item.getName());
//        helper.setText(R.id.tv_content,item.getDesrc());
        helper.setText(R.id.tv_price,mContext.getString(R.string.price_rmb,item.getPrice()));
        helper.setText(R.id.tv_sold,"销量"+item.getSold());
        Glide.with(mContext).load(item.getPic()).into((ImageView) helper.getView(R.id.iv_pic));
    }
}
